package com.ireadbooks.service.listener;

import com.ireadbooks.service.event.OrderStatusEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

/**
 * @program: spring-event-threadpool
 * @description: app消息
 * @author: wutao
 * @create: 2020/04/04 18:11
 **/
@Service
public class OrderAppMassageListener implements ApplicationListener<OrderStatusEvent> {
    private static final Logger logger = LoggerFactory.getLogger(OrderAppMassageListener.class);

    @Override
    public void onApplicationEvent(OrderStatusEvent event) {
        logger.info("OrderAppMassageListener 监听到消息：{}", event);
        
        logger.info("发送app消息。。。");
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
